package 对象.demo01;

public class Clock {
	// 组合
	private Display h = new Display(24);
	private Display m = new Display(60);

	public void start() {
		while (true){
			m.increase();
			if (m.getValue()==0){
				h.increase();
			}
			System.out.println("---------");
			System.out.printf("|%02d : %02d|\n",h.getValue(),m.getValue());

			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
	
	public static void main(String[] args) {
		Clock clock = new Clock();
		clock.start();
	}
}
